﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CSM.Controllers;

namespace CSM.Views.PublicPage
{
    public partial class ChangePassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }



        protected void Button_ChangePassword_Click(object sender, EventArgs e)
        {
            CSMAccount MyAccount = new CSMAccount();
            if (MyAccount.ModifyPassword(HttpContext.Current.Session[SystemVars.sysSessionUserId].ToString(), txtOldPwd.Text, txtNewPwd2.Text) != 0)
            {
           
                Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "message", " <script>alert('" + MyAccount.LastError+ "'); </script>");
             
            }
            else
            {
                Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "message", " <script>alert('修改密码成功!'); </script>");
             
            }
        }
    }
}
